package com.method;

import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;

import com.matang.R;

public class VersionMsg {


	public static int getVersionCode(Context context) {
		// return Integer.parseInt(context.getResources()
		// .getText(R.integer.app_VersionCode).toString());
		int code = 0;
		try {
			code = context.getPackageManager().getPackageInfo(
					"com.matang", 0).versionCode;
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return code;
	}

	public static String getVersionName(Context context) {
		return context.getResources().getText(R.string.app_VersionName)
				.toString();

	}

	public static String getAppName(Context context) {
		return context.getResources().getText(R.string.app_name).toString();

	}

}
